//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Collections.Generic;

namespace Microsoft.Research.DataLayer
{
    /// <summary>
    /// Fetches the security credential enumerator.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class SecurityCredentialEnumerator<T> : IEnumerator<ISecurityCredential>
    where T : ISecurityCredential
    {
        #region IEnumerator<ISecurityCredential> Members

        private IEnumerator<T> myEnum;

        public SecurityCredentialEnumerator(IEnumerator<T> myEnum)
        {
            this.myEnum = myEnum;
        }

        ISecurityCredential IEnumerator<ISecurityCredential>.Current
        {
            get { return myEnum.Current; }
        }

        #endregion

        #region IDisposable Members

        void IDisposable.Dispose()
        {
            myEnum.Dispose();
        }

        #endregion

        #region IEnumerator Members

        object System.Collections.IEnumerator.Current
        {
            get { return myEnum.Current; }
        }

        bool System.Collections.IEnumerator.MoveNext()
        {
            return myEnum.MoveNext();
        }

        void System.Collections.IEnumerator.Reset()
        {
            myEnum.Reset();
        }

        #endregion
    }

    
}
